This page last changed on Jun 13, 2005 by mroberts.

CruiseControl.NET has the following integration with CVS:

Modification Checking via polling
Automatic Source Updates
Automatic labelling on success
Web Integration with ViewCVS

Setting up a CVS project for use with CruiseControl.NET

CruiseControl.NET cannot (yet) automatically checkout a project from CVS - it can only perform updates. Before you start you must therefore checkout the project you want to integrate to a directory on your integration server. You can do this using your normal CVS client (command line, Tortoise etc.)

Make a note of the full path of your working directory (the uppermost directory that got checked out) since you're going to need that data for configuring your CruiseControl.NET server.

You'll also need a command line client installed on the integration server. We recommend using the latest stable Windows client from CVSHome.

Configuring CruiseControl.NET

You need to make sure you use the cvs Source Control block within your project. Read up on this configuration block here : CVS Source Control Block.

Automatic Source Updates

To have CCNet automatically retrieve the latest version of the source from CVS prior to running a build, you should set the autoGetSource attribute to true.

Automatic Labelling (Tagging)

To have CCNet automatically retrieve the latest version of the source from CVS prior to running a build, you should set the labelOnSuccess attribute to true. By default, the name of the tag is ver-buildLabel, but you can change the ver- prefix using the tagPrefix property of the CVS provider.

The contents of the tag will be the currently checked-out files in the build server's local working copy.

Web Integration with ViewCVS

If you have ViewCVS set up, you can link the modifications detected by CruiseControl.NET to the appropriate ViewCVS page by adding the following additional configuration information to the CVS source control section:

<webUrlBuilder type="viewcvs">
  <url>http://myviewcvsserver:7899/viewcvs/ccnet/NUnitDemo/</url>
</webUrlBuilder>

Simply change the <url> element to point to the root url for your module in ViewCVS.

Using CruiseControl.NET with CVS over SSH

Very often when using CVS it is best to use SSH as the authentication/transport protocol. This occurs (for example) if you are using a 'SourceForge' or 'GForge' instance for your source control. If you are setting up such a scenario, you may want to follow the steps below to help get you going:

  1. First you need to decide whether you are going to use password or key based authentication. Using keys is more secure, but using passwords is easier to setup initially. If you are going to use keys, you'll need to upload your public key to the server - we don't discuss that here but if you are using SourceForge, see here for some help.
  2. We are going to use 'putty' and 'plink' as our SSH client - download them here . In what follows, we're going to assume that putty and plink are both available in c:\putty.
  3. Start-up putty and create a session with the following details
    – a name that we will use later (e.g. 'mysourcecontrol')
    – SSH protocol
    – hostname set to the host of your source control server
    – Set your username in the 'auto-login username' box of the 'connection' tab
    – If you are using key-based authentication, setup your key details
    Once you've set all these up, save the session, then make sure you can connect (this is important since we need to allow the remote server's SSH key)
  4. We're going to assume in these steps that you are using the CVS command-line client in the 'tools' sub-directory of the CruiseControl home directory, but feel free to use another one of your choice
  5. CVS uses SSH as its transport when the 'ext' authentication type is specified in the CVSROOT (we'll see that later) and the CVS_RSH environment variable points to a SSH cilent. To set the environment variable, you can:
    – Set it as a system environment variable in Windows
    – Wrap the cvs.exe file with a batch script, e.g. use the 'cvswithplinkrsh.bat' batch file in the tools sub-directory.
    If you are using key-based authentication, set the CVS_RSH variable to be the full path of the 'plink.exe' executable. If you are using password-based authentication you'll need to use another batch file to wrap plink so that you can set the password. An example file is 'plinkwithpw.bat' in the tools sub-directory. Note that you'll be setting your CVS password in plain-text so you'll want to keep this file secure.
  6. Decide where you want your working copy of your source-control project to be located, e.g. 'c:\fromcvs\myproject'
  7. Check the project out from source control using the cvs client you are going to use with Cruise Control, e.g. as follows:
    – cd \fromcvs\myproject
    – c:\Program Files\CruiseControl.NET\tools\cvswithplinkrsh -d:ext:mysourcecontrol:/cvsroot/myproject co mymodule
    (here 'mysourcecontrol' corresponds to the putty session you setup in step 3, and the other items in bold are the CVS details for your project.
  8. Now we can setup the CruiseControl.NET config file itself by completing the <sourcecontrol> tag. Here's an example:
    <sourcecontrol type="cvs">
          <executable>c:\Program Files\CruiseControl.NET\tools\cvswithplinkrsh.bat</executable>
          <workingDirectory>C:\fromcvs\myproject\mymodule</workingDirectory>
          <cvsroot>:ext:mysourcecontrol:/cvsroot/myproject</cvsroot>
        </sourcecontrol>
Document generated by Confluence on Jun 26, 2005 17:23